package com.ybkj.daijia.api.driver;

import com.ybkj.daijia.server.exception.CanThrowToUserException;

public class Error {

    private int code;

    private String message;


    public Error(int code, String message) {
        super();
        this.code = code;
        this.message = message;
    }

    /***
     * 装换成CanThrowToUserException, 方便异常处理器同一处理
     * @return
     */
    public CanThrowToUserException changeToCanThrowToUserException(){
        return new CanThrowToUserException(message, code);
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}
